﻿namespace Compass.Maui.Services.FinishGoods;
public interface IFinishGoodsCountService:IBaseService<FinishedGoodsCountDto>
{
    Task<List<FinishedGoodsCountDto>> GetAllWithFeeAsync(bool showAll);
}
public class FinishGoodsCountService:BaseService<FinishedGoodsCountDto>,IFinishGoodsCountService
{
    private readonly IHttpRestClient _client;
    private const string ServiceName = "FinishedGoodsCount";
    public FinishGoodsCountService(IHttpRestClient client) : base(client, ServiceName)
    {
        _client = client;
    }

    public async Task<List<FinishedGoodsCountDto>> GetAllWithFeeAsync(bool showAll)
    {
        var request = new BaseRequest
        {
            Method = Method.Get,
            Route = $"{ServiceName}/All/WithFee?showAll={showAll}",
        };
        var response = await _client.ExecuteAsync<List<FinishedGoodsCountDto>>(request);
        return response.Status ? response.Result : new List<FinishedGoodsCountDto>();
    }



}